home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / FinderGrok / osa stuff / CAEDescriptor.h < prev    next >
C/C++ Source or Header  |  2000-06-23  |  2KB  |  52 lines

  1. #pragma once
  2.  
  3. #include <string>
  4.  
  5. class    CAEDescriptor {
  6. public:
  7.     AEDesc    mDesc;
  8.  
  9.             //    These operators sometimes let you appear to pass
  10.             //    the CAEDescriptor object rather than having to pass the
  11.             //    object.mDesc.
  12.             operator    AEDesc*() { return &mDesc; }
  13.             operator    AEDesc&() { return mDesc; }
  14.             operator    const AEDesc*() const { return &mDesc; }
  15.             operator    const AEDesc&() const { return mDesc; }
  16.     
  17.             CAEDescriptor(const AEDesc* inDesc);
  18.             CAEDescriptor();
  19.             CAEDescriptor(
  20.                     const AEDesc    &inDesc,
  21.                     AEKeyword        inKeyword,
  22.                     DescType        inDesiredType = typeWildCard);
  23.             CAEDescriptor(DescType inType, const void *inData, SInt32 inSize);
  24.             CAEDescriptor(Boolean inValue);
  25.             CAEDescriptor(SInt16 inValue);
  26.             CAEDescriptor(SInt32 inValue);
  27.             CAEDescriptor(OSType inValue);
  28.             CAEDescriptor(ConstStringPtr inString);
  29.             CAEDescriptor(const FSSpec&);
  30.             CAEDescriptor(const CAEDescriptor& inOther);
  31.             ~CAEDescriptor();
  32.     
  33.     static CAEDescriptor MakeList();        
  34.     CAEDescriptor&    operator=(const CAEDescriptor& rhs );
  35.     void            swap(CAEDescriptor& inOther);
  36.     
  37.     bool    HasData() const;
  38.     bool    IsList() const;
  39.     int        Count() const;
  40.     CAEDescriptor At(int index) const;
  41.     std::string AsString() const;
  42.     
  43.     void    Put(int index, DescType inType, const void *inData, SInt32 inSize);
  44.     void    Put(int index, const CAEDescriptor&);
  45.     CAEDescriptor Coerce(DescType inType) const;
  46.  
  47.     void    GetParamDesc(const AppleEvent& inAppleEvent, AEKeyword inKeyword,
  48.                             DescType inDesiredType);
  49.     void    GetOptionalParamDesc(const AppleEvent& inAppleEvent,
  50.                             AEKeyword inKeyword, DescType inDesiredType);
  51. };
  52.